/***************************************************************************
 *  Filename: dronemodeller.h
 *  Class: DroneModeller
 *  
 *  Copyright 2012  Mario Henrique Voorsluys
 *  <forcaeluz@gmail.com>
 *  
 ****************************************************************************/

/*
 *
 * This file is part of Lyricue.
 *
 *    Lyricue is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    Lyricue is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with Lyricue.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef DRONEMODELLER_H
#define DRONEMODELLER_H

#include <QObject>
#include <QTextStream>
#include <QFile>
#include <QMutex>

class DroneModeller : public QObject
{
    Q_OBJECT
public:
    explicit DroneModeller(QObject *parent = 0);
    
signals:
    void exit();
    void takeOff();
    void land();
    void emergency();
    void fly(float roll, float pitch, float yaw, float gaz);
    void newTarget(float x, float y, float z, float yaw);
    void changeFile(QString filename);
    void reset();
    void startController();
public slots:
    void run();
    void pitchModel();
    void rollModel();
    void yawModel();
    void gazModel();
    void stop();
    void fly2Pos();
private:
    QString fileName;
    QString uinput;
    QTextStream input;
    QTextStream output;
    QTextStream fileStream;
    qint64 testStartTime;
    QMutex mutex;
};

#endif // DRONEMODELLER_H
